﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
	/// <summary>
	/// Interaction logic for LoginControl.xaml
	/// </summary>
	public partial class LoginControl : UserControl
	{
		public LoginControl()
		{
			this.InitializeComponent();
		}

        private void bt_login_Click(object sender, RoutedEventArgs e)
        {
            if (OnLoginOk != null)
                OnLoginOk(this.user_name_txt.Text,this.pass_txt.Password);
        }
        public event Action<string,string> OnLoginOk;

        private void user_name_txt_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                bt_login_Click(null, null);
            }
        }

        private void bt_register_Click(object sender, RoutedEventArgs e)
        {

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //ListBox listbox = new ListBox();
            //listbox.Height=100;
            //listbox.Width = 166;
            //listbox.Margin = new Thickness(138, 68, 0, 0);
            //this.LayoutRoot.Children.Add(listbox);
        }
	}
}